
package com.jinbo.footmessage.utils;

import android.os.CountDownTimer;
import android.widget.Button;


/**
 * Created by gzpc on 2015/12/31.
 */

public class TimeCount extends CountDownTimer {
    Button mCountDown;

    public TimeCount(long millisInFuture, long countDownInterval, Button countDown) {
        super(millisInFuture, countDownInterval);//参数依次为总时长,和计时的时间间隔
        this.mCountDown = countDown;
    }

    @Override
    public void onTick(long l) {
        mCountDown.setClickable(false);
        mCountDown.setText(l / 1000 + "秒");
    }

    @Override
    public void onFinish() {
        mCountDown.setText("重新验证");
        mCountDown.setEnabled(true);
    }


    public void reset() {
        mCountDown.setText("重新验证");
        mCountDown.setEnabled(true);
    }



}
